<%--
  Created by IntelliJ IDEA.
  User: c
  Date: 2017-11-29
  Time: 10:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>入库明细信息查看</title>
    <%@include file="/WEB-INF/jsp/header.jsp"%>
</head>
<script src="${ctx}/statics/js/jquery-1.12.4.js"></script>
<style>
    table td{
        font: 14px 'microsoft yahei', 微软雅黑, Helvetica, Arial, Tahoma, 黑体, 宋体, sans-serif;
    }
</style>
<body>
<div class="container-fluid" style="width: 90%;">
    <div style="text-align: center">
        <span class="h3">药品入库明细信息</span>
    </div>
    <div>
        <p><label>入库编号：</label>&nbsp;${drugsto.dsNum}</p>
        <p><label >入库日期：</label>
            <fmt:formatDate value="${drugsto.planDate}" var="date" pattern="yyyy年MM月dd日"/>
            ${date}
        </p>

    </div>

    <table class="table table-bordered" style="margin-top: 16px;">
        <tr>
            <td colspan="2" class="text-center h4">入库基本信息</td>
        </tr>
        <tr>
            <td><label >供应商：</label><span>${drugsto.provider.proName}</span></td>
            <td><label >验收人：</label><span>${drugsto.worker.woName}</span></td>
        </tr>
        <tr>
            <td><label >联系人：</label><span>${drugsto.provider.proPerson}</span></td>
            <td><label >电&nbsp;&nbsp;&nbsp;话：</label><span>${drugsto.worker.woPhone}</span></td>
        </tr>
        <tr>
            <td><label >地&nbsp;&nbsp;&nbsp;址：</label><span>${drugsto.provider.proReaddress}</span></td>
            <td rowspan="3">
                <label >备&nbsp;&nbsp;&nbsp;注：</label>${drugsto.dsRemark}
            </td>
        </tr>
        <tr>
            <td><label >电&nbsp;&nbsp;&nbsp;话：</label><span>${drugsto.provider.proPhone}</span></td>

        </tr>
        <tr>
            <td><label >传&nbsp;&nbsp;&nbsp;真：</label><span>${drugsto.provider.proFax}</span></td>
        </tr>
    </table>

    <table id="delTable" class="table table-bordered ">
        <tr class="back">
            <th rowspan="2" class="text-center">
                <span style="line-height: 73px;">序号</span>
            </th>
            <th colspan="6" class="text-center">
                药品信息
            </th>
            <th colspan="2" class="text-center">
                价格(人民币:元)
            </th>
        </tr>
        <tr class="back">
            <th >药品名称</th>
            <th >规格</th>
            <th >入库数量</th>
            <th >单位</th>
            <th >有效日期</th>
            <th >批号</th>
            <th >单价(元)</th>
            <th >小计</th>
        </tr>
        <c:forEach items="${list}" var="p">
            <tr>
                <td>${p.dsdId}</td>
                <td>${p.druginfo.drugName}</td>
                <td>${p.druginfo.drugStandard}</td>
                <td class="delBuynum">${p.dsdBuynum}</td>
                <td>${p.druginfo.drugUnit}</td>
                <td>
                    <fmt:formatDate value="${p.dsdValiddate}" var="date" pattern="yyyy-MM-dd"/>
                    ${date}
                </td>
                <td>${p.dsdLotnum}</td>
                <td>${p.dsdBuyprice}</td>
                <td class="money" style="color: red;">
                    ￥<span><fmt:formatNumber type="number" value="${p.dsdBuynum*p.dsdBuyprice}" pattern="0.00" maxFractionDigits="2"/></span>
                </td>
            </tr>
        </c:forEach>
        <tr>
            <th colspan="3" style="text-align: right;">合计数量及金额：</th>
            <th>
                <span id="num"></span>
                <script>
                    var totalNum=0;
                    $("table#delTable td.delBuynum").each(function(){
                        totalNum+=parseInt( $(this).html());
                    });
                    $("span#num").html(totalNum)
                </script>
            </th>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th>
                <span id="totalMo"></span>
                <script>
                    var totalMoney=0.00;
                    $("table#delTable td.money").each(function(){
                        totalMoney+=parseFloat( $(this).find("span").html());
                    });
                    $("span#totalMo").html("￥"+totalMoney)
                </script>
            </th>
        </tr>
    </table>
</div>
<%@include file="/WEB-INF/jsp/footer.jsp"%>
<script src="${ctx}/res/js/Purplan.js"></script>
</body>
</html>
